# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=pipe-viewer
pkgver=0.4.8
pkgrel=0
pkgdesc="Lightweight YouTube client that does not require an YouTube API key"
url="https://github.com/trizen/pipe-viewer"
arch="noarch"
license="Artistic-2.0"
makedepends="perl-module-build"
depends="
	perl-data-dump
	perl-json
	perl-libwww
	perl-lwp-protocol-https
	perl-term-readline-gnu
	perl-unicode-linebreak
	"
checkdepends="perl-test-pod"
subpackages="$pkgname-doc $pkgname-gtk"
source="$pkgname-$pkgver.tar.gz::https://github.com/trizen/pipe-viewer/archive/$pkgver.tar.gz"

build() {
	perl Build.PL --gtk3
}

check() {
	./Build test
}

package() {
	./Build install --destdir "$pkgdir" --installdirs vendor
}

gtk() {
	depends="$pkgname perl-gtk3 perl-file-sharedir"
	pkgdesc="$pkgdesc (GTK interface)"

	amove usr/bin/gtk-pipe-viewer
	amove "usr/share/perl5/vendor_perl/auto/share/dist/WWW-PipeViewer/gtk-*"
	amove usr/share/perl5/vendor_perl/auto/share/dist/WWW-PipeViewer/icons
}

sha512sums="
0f7f9d8a2afbd8749a896410203ddeca7510d6f9f21868ba940fd8e9a98176f519554c4cf1df562f4734685480b9b003033ffc53b7055b50ffda0a1012d8beaf  pipe-viewer-0.4.8.tar.gz
"
